import Vue from 'vue';//创建vue实例
import VueRouter from 'vue-router';//创建路由
import Msite from '../pages/Msite/Msite.vue';//创建首页
import Search from '../pages/Search/Search.vue';//创建搜索页
import Order from '../pages/Order/Order.vue';//创建订单页
import Profile from '../pages/Profile/Profile.vue';//创建个人中心页
import Login from '../pages/Two/Login/Login.vue';//创建登陆页面
import Personal from '../pages/Two/Personal/Personal.vue';//创建个人资料
import Commodity from '../pages/Two/commodity/commodity.vue';//创建商家商品
import Meun from '../pages/Two/commodity/menu/menu.vue';//创建二级路由点餐
import Evaluate from '../pages/Two/commodity/evaluate/evaluate.vue';//创建二级路由评价
import Business from '../pages/Two/commodity/business/business.vue';//创建二级路由商家

Vue.use(VueRouter);//用vue关联路由

export default new VueRouter({
  routes: [
    //首页路由
    {
      path: '/msite',
      component: Msite,
      meta:{
        showFooter: true
      }
    },
    //搜索页路由
    {
      path: '/search',
      component: Search,
      meta:{
        showFooter: true
      }
    },
    //订单页路由
    {
      path: '/order',
      component: Order,
      meta:{
        showFooter: true
      }
    },
    //个人中心页路由
    {
      path: '/profile',
      component: Profile,
      meta:{
        showFooter: true
      }
    },
    //默认首页
    {
      path: '/',
      redirect: '/msite'
    },
    //登陆页面
    {
      path: '/login',
      component: Login
    },
    //个人资料
    {
      path: '/personal',
      component: Personal
    },
    //商家商品
    {
      path: '/commodity',
      component: Commodity,
      children: [
        //点餐
        {
          path: '/commodity/meun',
          component: Meun
        },
        //评价
        {
          path: '/commodity/evaluate',
          component: Evaluate
        },
        //商家
        {
          path: '/commodity/business',
          component: Business
        },
        //默认
        {
          path: '/',
          redirect: '/commodity/meun'
        }
      ]
    }
  ],
  linkActiveClass: 'on'
})
